Skip to content

release: 2.47.0#3513

Open
stainless-app[bot] wants to merge 3 commits into
mainfrom
release-please--branches--main--changes--next
Open

release: 2.47.0#3513
stainless-app[bot] wants to merge 3 commits into
mainfrom
release-please--branches--main--changes--next

Conversation

@stainless-app

@stainless-app stainless-app Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Automated Release PR

2.47.0 (2026-07-21)

Full Changelog: v2.46.0...v2.47.0

Features

  • client: Add experimental runtime support for HTTPX2 clients (#3524) (317260c)
  • stlc: configurable CI runner and private-production-repo support in workflow templates (4303e97)

Bug Fixes

  • deps: require patched aiohttp on Python 3.10+ (#3515) (d4dceb2)

This pull request is managed by Stainless's GitHub App.

The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.

For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.

🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions

@openai-sdks

openai-sdks Bot commented Jul 17, 2026

Copy link
Copy Markdown

OkTest Summary

237/237 SDK tests passed in 12.6s for Python SDK PR #3513.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 206ms
tests/chat-completions-create.test.ts ✅ Passed 293ms
tests/chat-completions-stream.test.ts ✅ Passed 167ms
tests/files-content-binary.test.ts ✅ Passed 274ms
tests/files-create-multipart.test.ts ✅ Passed 268ms
tests/files-list-pagination.test.ts ✅ Passed 183ms
tests/initialize-config.test.ts ✅ Passed 195ms
tests/instance-isolation.test.ts ✅ Passed 237ms
tests/models-list.test.ts ✅ Passed 248ms
tests/responses-background-lifecycle.test.ts ✅ Passed 265ms
tests/responses-body-method-errors.test.ts ✅ Passed 422ms
tests/responses-cancel-timeout.test.ts ✅ Passed 223ms
tests/responses-cancel.test.ts ✅ Passed 341ms
tests/responses-compact-retries.test.ts ✅ Passed 395ms
tests/responses-compact.test.ts ✅ Passed 439ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 133ms
tests/responses-create-advanced.test.ts ✅ Passed 263ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.244s
tests/responses-create-errors.test.ts ✅ Passed 251ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 288ms
tests/responses-create-retries.test.ts ✅ Passed 349ms
tests/responses-create-stream-failures.test.ts ✅ Passed 153ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 234ms
tests/responses-create-stream-wire.test.ts ✅ Passed 4.047s
tests/responses-create-stream.test.ts ✅ Passed 305ms
tests/responses-create-terminal-states.test.ts ✅ Passed 273ms
tests/responses-create-timeout.test.ts ✅ Passed 235ms
tests/responses-create.test.ts ✅ Passed 270ms
tests/responses-delete.test.ts ✅ Passed 262ms
tests/responses-input-items-errors.test.ts ✅ Passed 400ms
tests/responses-input-items-list.test.ts ✅ Passed 354ms
tests/responses-input-items-options.test.ts ✅ Passed 366ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 248ms
tests/responses-input-tokens-count.test.ts ✅ Passed 271ms
tests/responses-malformed-inputs.test.ts ✅ Passed 3.207s
tests/responses-not-found-errors.test.ts ✅ Passed 322ms
tests/responses-parse.test.ts ✅ Passed 479ms
tests/responses-retrieve-retries.test.ts ✅ Passed 327ms
tests/responses-retrieve.test.ts ✅ Passed 252ms
tests/responses-stored-method-errors.test.ts ✅ Passed 722ms
tests/retry-behavior.test.ts ✅ Passed 3.311s
tests/sdk-error-shape.test.ts ✅ Passed 407ms

View OkTest run #29868011676

SDK merge (4e00d239c6d9) · head (638895dcb5d7) · base (d4dceb221b9a) · OkTest (38f2e7c0559b)

@stainless-app
stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from 3ff9590 to f445f34 Compare July 17, 2026 19:14
@stainless-app
stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from f445f34 to 710c1d2 Compare July 17, 2026 20:29

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 710c1d2035

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread pyproject.toml
[project]
name = "openai"
version = "2.46.0"
version = "2.47.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update uv.lock for the release version

Changing the project version here also changes the local package metadata that uv locks. In this commit, uv.lock still records the editable openai package as version = "2.46.0" while pyproject.toml and _version.py now say 2.47.0; I verified with a minimal uv project that a version-only pyproject change makes uv lock --check report that the lockfile needs updating. Anyone using the committed uv.lock or a locked uv sync will hit a stale-lock failure or get a dirty regenerated lockfile until the lock is updated.

Useful? React with 👍 / 👎.

apcha-oai and others added 2 commits July 21, 2026 16:57
)

Refs #3375.

## Summary

Adds experimental runtime support for using an HTTPX2 client with the
2.x SDK:

```sh
pip install 'openai[httpx2]'
```

```python
from openai import OpenAI, AsyncOpenAI, DefaultHttpx2Client, DefaultAsyncHttpx2Client

client = OpenAI(http_client=DefaultHttpx2Client())
async_client = AsyncOpenAI(http_client=DefaultAsyncHttpx2Client())
```

HTTPX remains installed, imported, and authoritative for the SDK's
public transport types. Existing HTTPX clients and helpers continue to
work unchanged. This is an explicit runtime opt-in, not a
default-transport or typing migration: generated/parsed API models
remain accurately typed, while _raw requests, responses, streams, and
transport exceptions can be HTTPX2 objects even where annotations still
describe HTTPX_.

The implementation keeps the compatibility boundary small:

- accepts sync, async, and module-level HTTPX2 clients and preserves
their native request/response/exception family;
- supplies `DefaultHttpx2Client` and `DefaultAsyncHttpx2Client` with the
SDK defaults, while retaining the existing HTTPX and aiohttp helpers;
- handles the concrete request, timeout, URL, response-casting, retry,
streaming, auth, and provider differences needed at runtime;
- makes workload-identity token exchange follow an explicitly selected
HTTPX2 client (including async clients, whose exchange still runs
synchronously in the existing worker-thread path), without changing
behavior merely because HTTPX2 happens to be installed.

The `httpx2` extra is available on Python 3.10+ and scopes its resolver
requirements to the opt-in path (`httpx>=0.25.1,<1`, `httpx2>=2.7,<3`,
and `anyio>=4.10,<5`). Base installations retain the existing Python,
HTTPX, and AnyIO floors. On Python 3.9 the extra is marker-skipped and
invoking an HTTPX2 helper produces an actionable error. Intentionally
mixed HTTPX/HTTPX2 transports or auth implementations are out of scope.

## Gaps
- This pr does not address `aiohttp`+ `httpx2`; that can be a future
addition if there is interest. This would require a separate addon and
for us to vendor in some of the implementation; so avoiding in this PR.
- Types stay on `httpx`, and `httpx` is still required to be an
installed package.
- reasoning: we considered `httpx | httpx2` as a migration shim, or
returning `httpx2` type annotations. Will continue to evaluate the
ecosystem, although `httpx2` types will unfortunately likely require
many updates from downstream packages. Saving those considerations for
potential future major versions.
- For now, we do not address `httpx.timeout` annotations in generated
code as well

## Testing

The HTTPX2 CI lane runs the normal suite with native HTTPX2 sync/async
clients in both Pydantic modes. Existing RESPX-backed cases are
exercised through a small, test-only bridge: HTTPX2 uses a native
`MockTransport`, the bridge translates only at the RESPX
matching/callback boundary, and the SDK still builds and receives native
HTTPX2 requests/responses. This keeps generated binary/raw/streaming,
retry, auth, Azure, Bedrock, and snapshot coverage shared instead of
maintaining duplicate tests; aiohttp remains a separate HTTPX-family
path.

Focused native tests also cover client defaults, direct injection,
raw/SSE/multipart, retries and exception families, hooks/mounts/proxies,
provider auth, workload-identity exchange/cache/401 refresh, and
base-only/extra resolver behavior. Local full-suite runs pass with
HTTPX2/Pydantic 2 and the HTTPX2 floor/Pydantic 1; the ordinary HTTPX
suite and lint/type checks remain clean.
@stainless-app
stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from 710c1d2 to 638895d Compare July 21, 2026 20:58
Comment thread tests/test_httpx2.py
try:
assert client.models.list().object == "list"
finally:
client.close()
Comment thread tests/test_httpx2.py
import httpx
import pytest

import openai
Comment thread tests/test_httpx2_base.py
import respx
import pytest

import openai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant